import axios from '@/util'; 

import type {
  OssEntity,
} from './typings';



/**
 * 文件上传,返回 url 地址 POST /api/oss/upload
 */
export async function post_api_oss_upload (
  data: {
    /**  */
    unknownParam?: any;
  },
  options?: Record<string, any>,
): Promise<OssEntity> {
  return axios({
    method: 'POST',
    url: `/api/oss/upload`,
    data: {
      ...data,
    },
    ...(options || {}),
  })
}

/**
 * 查询文件上传列表 GET /api/oss/list
 */
export async function get_api_oss_list (
  params: {
    /** 显示页数 */
    page: any;
    /** 每页显示条数 */
    size: any;
    /** 搜索条件，起始时间 */
    startDay?: any;
    /** 搜索条件，结束时间 */
    endDay?: any;
  },
  options?: Record<string, any>,
): Promise<OssEntity> {
  return axios({
    method: 'GET',
    url: `/api/oss/list`,
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/**
 * 根据URL删除文件 DELETE /api/oss/{url}
 */
export async function delete_api_oss__url_ (
  pathVars: {
    /**  */
    url: any;
  },
  options?: Record<string, any>,
): Promise<any> {
  return axios({
    method: 'DELETE',
    url: `/api/oss/${pathVars.url}`,
    ...(options || {}),
  })
}
